package de.haw.vehicle;

import de.haw.adt.implementation.Values;
import de.haw.adt.interfaces.IAcc;
import de.haw.adt.interfaces.IForce;
import de.haw.adt.interfaces.IMass;
import de.haw.adt.interfaces.IPower;
import de.haw.adt.interfaces.ISpeed;
import de.haw.world.IWorld;

public class Porsche911GT2RS implements IVehicle {

	// Gewicht in KG
	private static IMass mass = Values.massInKg(1445);
	// Leistung in W
	private static IPower powerPropMax = Values.powerInW(456 * Values.KILO);
	// Maximalgeschwindigkeit in m/s
	//private static final double speedMax = 330 / KMH_IN_MS;
	public static ISpeed speedMax = Values.speedInMs(330/Values.KMH_IN_MS);
	// maximale Beschleunigungskraft N(kgms-2)
	private double forcePropMax;
	private double forceBrakeMax;
	private double dragConst = Math.abs(powerPropMax.getW() / Math.pow(speedMax.getMs(),3));

	private IAcc acc;
	private double forcePropAbs;
	private double forceProp;
	private IForce force;
	private double time;
	private double pos;
	private ISpeed speed;
	private double powerProp;
	private double level;
	private double brakelevel;
	private double forceDrag;
	private double brakeProp;
	private boolean asr;
	private boolean abs;
	private boolean drive;
	private double forceBrakeAbs;
	private double forceBrake;
	private double powerBrake;

	public Porsche911GT2RS(IWorld world) {
//		world.setGround(IWorld.GROUND_ICE);
		forcePropMax = mass.getKg() * world.getTraction();
		forceBrakeMax = world.getGravitationalAcceleration() * mass.getKg() * 3;
		//Geschwindigkeit setzen sonst NULL-Pointer Exception
		setSpeed(Values.speedInMs(0.0));
	}

	public void setAcc(IAcc acc) {
		this.acc = acc;

	}

	public IAcc getAcc() {
		return acc;
	}

	public void setForcePropAbs(double forcePropAbs) {
		this.forcePropAbs = forcePropAbs;

	}

	public double getForcePropAbs() {
		return forcePropAbs;
	}

	public void setForceProp(double forceProp) {
		this.forceProp = forceProp;
	}

	public double getForceProp() {
		return forceProp;
	}

	public double getDragConst() {
		return dragConst;
	}

	public void setForce(IForce force) {
		this.force = force;

	}

	public IForce getForce() {
		return force;
	}

	public void setTime(double time) {
		this.time = time;
	}

	public double getTime() {
		return time;
	}

	public void setPos(double pos) {
		this.pos = pos;
	}

	public double getPos() {
		return pos;
	}

	public void setSpeed(ISpeed speed) {
		this.speed = speed;
	}

	public ISpeed getSpeed() {
		return speed;
	}

	public void setPowerProp(double powerProp) {
		this.powerProp = powerProp;

	}

	public double getPowerProp() {
		return powerProp;
	}

	public void setLevel(double level) {
		this.level = level;
	}

	public double getLevel() {
		return level;
	}

	// Bremse
	public void setBrakelevel(double brakelevel) {
		this.brakelevel = brakelevel;
	}

	public double getBrakelevel() {
		return brakelevel;
	}

	public double getForceBrakeMax() {
		return forceBrakeMax;
	}
	public void setForceBrakeMax(double forceBrakeMax) {
		this.forceBrakeMax = forceBrakeMax;

	}

	public double getBrakeProp() {
		return brakeProp;
	}

	public void setBrakeProp(double brakeProp) {
		this.brakeProp = brakeProp;

	}

	//
	public double getPowerPropMax() {
		return powerPropMax.getW();
	}

	public void setForcePropMax(double forcePropMax) {
		this.forcePropMax = forcePropMax;
	}
	
	public double getForcePropMax() {
		return forcePropMax;
	}

	public void setForceDrag(double forceDrag) {
		this.forceDrag = forceDrag;
	}

	public double getForceDrag() {
		return forceDrag;
	}

	public IMass getMass() {
		return mass;
	}

	public void setASR(boolean asr) {
		this.asr = asr;
	}

	public boolean isASR() {
		return asr;
	}

	public void setABS(boolean abs) {
		this.abs = abs;
	}

	public boolean isABS() {
		return abs;
	}

	public void setForceBrakeAbs(double forceBrakeAbs) {
		this.forceBrakeAbs = forceBrakeAbs;
	}

	public double getForceBrakeAbs() {
		return forceBrakeAbs;
	}

	public double getForceBrake() {
		return forceBrake;
	}

	public void setForceBrake(double forceBrake) {
		this.forceBrake = forceBrake;
	}
	
	public void setPowerBrake(double powerBrake) {
		this.powerBrake = powerBrake;
		
	}

	public double getPowerBrake() {
		return powerBrake;
	}
	
	public void setDrive(boolean drive) {
		this.drive = drive;
	}

	public boolean isDrive() {
		return drive;
	}

}
